﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Model;
using Bll;

namespace WebApiServer.Controllers
{
    public class HomeController : ApiController
    {
        UsertBLL bll = new UsertBLL();//实例化Bll
        #region 注册
        public int GetRegin(string account, string pwd, string name, string addr, string tel)
        {
            if (bll.Regin(account, pwd, name, addr, tel) == 1)
            {
                return 1;//执行注册
            }
            else if (bll.Regin(account, pwd, name, addr, tel) == 2)
            {
                return 2;//验证手机号
            }
            else
            {
                return 0;//注册失败
            }
        }
        #endregion

        #region 登录
        public int Getlogin(string account, string pwd)
        {
            return bll.login(account, pwd);
        }
        #endregion

    }
}
